<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Master extends Admin_My_Controller {    

    function __construct() {
        parent::__construct();

        /* Standard Libraries of codeigniter are required */
        $this->load->database();
        $this->load->helper('url');
        /* ------------------ */

        $this->load->library('ExCRUD');        
    }

    function data_bank(){
        $crud = new ExCRUD();
        $crud->set_table('master_bank');
        $crud->required_fields('nama_bank','cabang','nomor_rekening','use_dollar');
        $output = $crud->render();
        $this->loadMenuDML('/template/dml_view',$output);
    }
    
    function setting_libur(){
        $crud = new ExCRUD();
        $crud->set_table('setting_libur');
        $crud->required_fields('tanggal');
        $output = $crud->render();
        $this->loadMenuDML('/template/dml_view',$output);
    }
    
    function data_prosesentase_lembur(){
        $crud = new ExCRUD();
        $crud->set_table('tipe_lembur');
        $crud->required_fields('prosentase_gaji_pokok');
        $output = $crud->render();
        $this->loadMenuDML('/template/dml_view',$output);
    }

    function data_port(){
        $crud = new ExCRUD();
        $crud->set_table('master_port');
        $crud->required_fields('nama_port','lokasi_port');
        $output = $crud->render();
        $this->loadMenuDML('/template/dml_view',$output);
    }

    function data_vessel(){
        $crud = new ExCRUD();
        $crud->set_table('master_vessel');
        $crud->required_fields('nama_vessel');
        $output = $crud->render();
        $this->loadMenuDML('/template/dml_view',$output);
    }

    function data_customer(){
        $crud = new ExCRUD();
        $crud->set_table('master_customer');
        $crud->required_fields('nama_customer','telepon_customer');
        $output = $crud->render();
        $this->loadMenuDML('/template/dml_view',$output);
    }

    function data_supplier(){
        $crud = new ExCRUD();
        $crud->set_table('master_supplier');
        $crud->required_fields('nama_supplier','telepon_supplier');
        $output = $crud->render();
        $this->loadMenuDML('/template/dml_view',$output);
    }

    function data_item(){
        $crud = new ExCRUD();
        $crud->set_table('master_item');
        $crud->required_fields('nama_item','satuan_beli');
        $crud->set_relation('id_port','master_port','nama_port');
        $crud->display_as('id_port', 'Port');
        $crud->where("id_item <> 1");
        $output = $crud->render();
        $this->loadMenuDML('/template/dml_view',$output);
    }

    function setting_term_condition(){
        $crud = new ExCRUD();
        $crud->set_table('master_term_condition');
        $crud->required_fields('nama_tc','isi_tc');
        $output = $crud->render();
        $this->loadMenuDML('/template/dml_view',$output);
    }

    function setting_laporan(){
        $crud = new ExCRUD();
        $crud->set_table('master_setting_laporan');
        $crud->required_fields('nama_laporan','tampilkan_header');
        $output = $crud->render();
        $this->loadMenuDML('/template/dml_view',$output);
    }

    function jenis_kas_operasional(){        
        $crud = new ExCRUD();       
        $crud->set_table('jenis_kas_operasional');        
        $crud->required_fields('nama_jko');
        $crud->display_as('nama_jko', 'Nama Jenis');
        $output = $crud->render();       
        $this->loadMenuDML('/template/dml_view',$output);
    }

    function sub_jenis_kas_operasional(){
        $crud = new ExCRUD();
        $crud->set_table('sub_jenis_kas_operasional');
        $crud->required_fields('nama_sjko');
        $crud->display_as('nama_sjko', 'Nama Sub Jenis');
        $crud->set_relation('id_jko','jenis_kas_operasional','nama_jko');
        $crud->display_as('id_jko', 'Nama Jenis');
        $output = $crud->render();
        $this->loadMenuDML('/template/dml_view',$output);
    }

    function jenis_kas_penjualan(){
        $crud = new ExCRUD();
        $crud->set_table('jenis_kas_penjualan');
        $crud->required_fields('nama_jkp');
        $crud->display_as('nama_jkp', 'Nama Jenis');
        $output = $crud->render();
        $this->loadMenuDML('/template/dml_view',$output);
    }

    function sub_jenis_kas_penjualan(){
        $crud = new ExCRUD();
        $crud->set_table('sub_jenis_kas_penjualan');
        $crud->required_fields('nama_sjkp');
        $crud->display_as('nama_sjkp', 'Nama Sub Jenis');
        $crud->set_relation('id_jkp','jenis_kas_penjualan','nama_jkp');
        $crud->display_as('id_jkp', 'Nama Jenis');
        $output = $crud->render();
        $this->loadMenuDML('/template/dml_view',$output);
    }
}



/* End of file main.php */
/* Location: ./application/controllers/main.php */